﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TMS_BackEnd.Models.SH;

namespace TMS_BackEnd.Configers
{
    public class sys_menuConfigers : IEntityTypeConfiguration<sys_menu>
    {
        public void Configure(EntityTypeBuilder<sys_menu> builder)
        {
            builder.ToTable(nameof(sys_menu));
            builder.HasKey(e => e.menu_id);  
            builder.Property(e => e.menu_name).HasMaxLength(50).IsRequired();
            builder.Property(e => e.parent_id).HasColumnType("bigint");
            builder.Property(e=>e.path).HasMaxLength(200).IsRequired();
            builder.Property(e=>e.component).HasMaxLength(255).IsRequired();
            builder.Property(e=>e.query).HasMaxLength(255).IsRequired();
            builder.Property(e=>e.menu_type).HasMaxLength(255);
            builder.Property(e => e.visible).HasColumnType("char").HasMaxLength(1).HasDefaultValue("0");
            builder.Property(e => e.status).HasColumnType("char").HasMaxLength(1).HasDefaultValue(0);
        }
    }
}
